/**
*  \file u2c_dataexcharge.h
*
*  \brief
*
*  \author
*
*
*
*
*
*/
#ifndef U2C_DATAEXCHARGE_H_INCLUDED	
#define U2C_DATAEXCHARGE_H_INCLUDED

/*================================================[ public includes  ]================================================*/
#include "../cfg/prj.h"
#include "../direction_switch/direction_switch.h"

/*================================================[ public defines   ]================================================*/
struct u2c_data_output_obj
{
	/*vehicle pdo 1*/
	S16	vehicle_steer_angle_v;
    U8 vehicle_pdo1_reserve0;
    U8 vehicle_pdo1_reserve1;
	U8 vehicle_park_brake_in_v;
	U8 vehicle_neutral_position_v;
	U8 vehicle_reverse_in_v;
	U8 vehicle_forward_in_v;
	U8 vehicle_option_pedal_v;
	U8 vehicle_option_steerAngleSensor_v;
	U8 vehicle_vehicle_int_pdo1_counter;
	U8 vehicle_inv2_enable_v;
	U8 vehicle_inv1_enable_v;
	U8 vehicle_seat_switch_in_v;
	U8 vehicle_seat_switch_nc_in_v;
	S16 vehicle_int_pdo1_checksum;

	/*vehicle pdo 2*/
    S16 vehicle_accelerator_v;
	S16 vehicle_dc_link_in_v;
	U8  vehicle_pdo2_reserve0;
	U8 vehicle_int_pdo2_counter;
	S16 vehicle_int_pdo2_chechsum;

	/*vehicle pdo 3*/
    S16 vehicle_traction_motor_speed_v;
	S16 vehicle_current_sensors_vol_v;   /*5v*/
	U8  vehicle_pdo3_reserve1;
	U8 vehicle_int_pdo3_counter;
	U8  vehicle_pdo3_reserve2;
	S16 vehicle_int_pdo3_chechsum;

	/*vehicle pdo 4*/
	S16 vehicle_power_supply_v;
	S16 vehicle_key_switch_in_v;
	U8  vehicle_pdo4_reserve1;
	U8 vehicle_int_pdo4_counter;
	U8  vehicle_pdo4_reserve2;
	S16 vehicle_int_pdo4_chechsum;
    
	
};

struct u2c_data_input_obj
{

	/*motor pdo1*/
	U8 motor_pdo1_reserve0;
	U8 motor_pdo1_reserve1;
	S16	motor_steer_angle_m;
	U8 motor_park_brake_in_m;
	U8 motor_neutral_position_m;
	U8 motor_reverse_in_m;
	U8 motor_forward_in_m;
	U8 motor_pdo1_reserve2;
	U8 motor_keyswitch_in_m;
	S16 motor_int_pdo1_counter;
	U8 motor_inv2_enable_m;
	U8 motor_inv1_enable_m;
	U8 motor_seat_switch_in_m;
	U8 motor_seat_switch_nc_in_m;
	S16 motor_int_pdo1_checksum;
     
	
	/*motor pdo 2*/
	S16 motor_accelerator_m;
	S16 motor_dc_link_in_m;
	U8  motor_pdo2_reserve0;
	S16 motor_int_pdo2_counter;
	U8 motor_power_board_variant_m;
	S16 motor_int_pdo2_chechsum;


	/*motor pdo 3*/
    S16 motor_current_sensors_vol_m;    /* 5v*/
    U16 motor_pdo3_reserve0;
    U8  motor_pdo3_reserve1;
	S16 motor_int_pdo3_counter;
	U8  motor_pdo3_reserve2;
	S16 motor_int_pdo3_chechsum;

	/*motor pdo 4*/
	S16 motor_power_supply_m;	
	U16 motor_pdo4_reserve0;
	U8  motor_pdo4_reserve1;
	S16 motor_int_pdo4_counter;
	U8  motor_pdo4_reserve2;
	S16 motor_int_pdo4_chechsum;
	
};
/*================================================[ public datatypes ]================================================*/

/*================================================[ public variables ]================================================*/

/*================================================[ inline functions ]================================================*/

/*================================================[ public functions ]================================================*/
/**
*  Initialization.
*
*  Initialize the control_buzzer module.
*
*  \return RC_SUCCESS if successful.
*/
RC u2c_dataexchange_initialize( void );

/**
*/

BO u2c_dataexchange_10ms(void);



/*====================================================================================================================*/

#endif

/***********************************************************************************************************************
*                             Copyright 2020 Linde Material Handling. All rights reserved.                             *
***********************************************************************************************************************/

